extends "../cTDR_1/cTDR_1.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "神射手"
	lv = 3
	attCoe.atk = 24 / 8.5 * 2 / 3
	attCoe.maxHp = 700 / 112.5 / 3
	attAdd.criR += 0.7
	addCdSkill("sss3",9)
	addSkillTxt("箭雨：暴击时有18%的几率触发箭雨对当前敌人及其周围1格所有敌人造成100%伤害，附加1层<攻速提升>")
	addSkillTxt("爆射：[主动]对当前敌人造成333%物理伤害[cd:9秒][被动]爆伤+70%")
var pw1 = 18
func _castCdSkill(id):
	._castCdSkill(id)
	if id == "sss3" && aiCha:
		cst("爆射","000000",position)
		hurtChara(aiCha,att.atk*3.33,Chara.HurtType.PHY,Chara.AtkType.SKILL)
func _onAtkInfo(atkinfo):
	if atkinfo.hitCha == self:return
	if atkinfo.isCri:
		if !sys.rndPer(pw1):return
		cst("箭雨","000000",position)
		var cha = atkinfo.hitCha
		var chas = getAllChas(1)
		for i in chas:
			if abs(i.cell.x - cha.cell.x) <= 1 && abs(i.cell.y - cha.cell.y) <= 1:
				if !i:
					hurtChara(i,att.atk,Chara.HurtType.PHY,Chara.AtkType.EFF)
		self.addBuff(ctrl.b_gsts.new(1))
	._onAtkInfo(atkinfo)
